package s20.ch23.ex1;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

public class MyMap {

	public static void main(String[] args) {
		Map<String, Object> map = new HashMap<String,Object>();

		map.put("object1", new Object());
		map.put("object2", new Object());

		System.out.println(map);
		System.out.println(map.get("object1"));

		map.put("object1", new Object());
		System.out.println(map);
		System.out.println(map.get("object1"));

		for (Entry<String, Object> entry : map.entrySet()) {
			System.out.println(entry.getKey());
			System.out.println(entry.getValue());
		}
	}

}
